/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('dytnsapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CertNoThreeElementVerificationRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='QASDW@#**'),
  certName?: string(name='CertName', description='This parameter is required.', example='示例值'),
  certNo?: string(name='CertNo', description='This parameter is required.', example='3***************0'),
  certPicture?: string(name='CertPicture', description='This parameter is required.', example='iVBOFMKODOFNDFP123DFSMOO...'),
  mask?: string(name='Mask', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CertNoThreeElementVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='-'),
  code?: string(name='Code', example='OK'),
  data?: {
    isConsistent?: string(name='IsConsistent', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='68A40250-50CD-034C-B728-0BD******177'),
}

model CertNoThreeElementVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CertNoThreeElementVerificationResponseBody(name='body'),
}

/**
 * @summary 身份证三要素
 *
 * @param request CertNoThreeElementVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CertNoThreeElementVerificationResponse
 */
async function certNoThreeElementVerificationWithOptions(request: CertNoThreeElementVerificationRequest, runtime: Util.RuntimeOptions): CertNoThreeElementVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.certNo)) {
    query['CertNo'] = request.certNo;
  }
  if (!Util.isUnset(request.certPicture)) {
    query['CertPicture'] = request.certPicture;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CertNoThreeElementVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份证三要素
 *
 * @param request CertNoThreeElementVerificationRequest
 * @return CertNoThreeElementVerificationResponse
 */
async function certNoThreeElementVerification(request: CertNoThreeElementVerificationRequest): CertNoThreeElementVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return certNoThreeElementVerificationWithOptions(request, runtime);
}

model CertNoTwoElementVerificationRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='QASDW@#**'),
  certName?: string(name='CertName', description='This parameter is required.', example='示例值'),
  certNo?: string(name='CertNo', description='This parameter is required.', example='331021200001010000'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CertNoTwoElementVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='-'),
  code?: string(name='Code', example='OK'),
  data?: {
    isConsistent?: string(name='IsConsistent', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model CertNoTwoElementVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CertNoTwoElementVerificationResponseBody(name='body'),
}

/**
 * @summary 身份证二要素认证
 *
 * @param request CertNoTwoElementVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CertNoTwoElementVerificationResponse
 */
async function certNoTwoElementVerificationWithOptions(request: CertNoTwoElementVerificationRequest, runtime: Util.RuntimeOptions): CertNoTwoElementVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!Util.isUnset(request.certNo)) {
    query['CertNo'] = request.certNo;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CertNoTwoElementVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份证二要素认证
 *
 * @param request CertNoTwoElementVerificationRequest
 * @return CertNoTwoElementVerificationResponse
 */
async function certNoTwoElementVerification(request: CertNoTwoElementVerificationRequest): CertNoTwoElementVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return certNoTwoElementVerificationWithOptions(request, runtime);
}

model CompanyFourElementsVerificationRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the [My Applications](https://dytns.console.aliyun.com/analysis/apply) page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/overview?spm=a2c4g.608385.0.0.79847f8b3awqUC), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  epCertName?: string(name='EpCertName', description='The enterprise name.', example='示例值示例值'),
  epCertNo?: string(name='EpCertNo', description='The business license number.

This parameter is required.', example='9242032*******J627'),
  legalPersonCertName?: string(name='LegalPersonCertName', description='The name of the legal representative.

>  If an enterprise has multiple legal representatives, separate them with commas (,).

This parameter is required.', example='示例值'),
  legalPersonCertNo?: string(name='LegalPersonCertNo', description='The ID card number of the legal representative.

>  If an enterprise has multiple legal representatives, separate the ID card numbers with commas (,).

This parameter is required.', example='331021********0011'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CompanyFourElementsVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='-'),
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: {
    detailInfo?: {
      enterpriseStatus?: string(name='EnterpriseStatus', description='The business status of the enterprise.', example='Active'),
      openTime?: string(name='OpenTime', description='The business term of the enterprise.', example='2023-05-25/2053-05-24'),
    }(name='DetailInfo', description='The information about the enterprise.'),
    inconsistentData?: [ string ](name='InconsistentData', description='The fields to be verified.'),
    reasonCode?: long(name='ReasonCode', description='The code of the verification result. Valid values:

*   0: The four elements belong to the same enterprise.
*   1: The four elements belong to the same enterprise, but the business status of the enterprise is abnormal.
*   2: The legal representative information cannot match the enterprise information.
*   3: The four elements do not belong to the same enterprise.
*   4: No information about the enterprise is found.
*   5: No information about the legal representative is found.', example='0'),
    verifyResult?: string(name='VerifyResult', description='The verification result. Valid values:

*   true: The four elements belong to the same enterprise and the business status of the enterprise is Active.
*   false: The four elements do not belong to the same enterprise.', example='true'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model CompanyFourElementsVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompanyFourElementsVerificationResponseBody(name='body'),
}

/**
 * @summary Verifies whether the enterprise name, the business license number, and the name and ID card of the legal representative belong to the same enterprise. The verification is successful only when the preceding four elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to four-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0, 1, or 2.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyFourElementsVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompanyFourElementsVerificationResponse
 */
async function companyFourElementsVerificationWithOptions(request: CompanyFourElementsVerificationRequest, runtime: Util.RuntimeOptions): CompanyFourElementsVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.epCertName)) {
    query['EpCertName'] = request.epCertName;
  }
  if (!Util.isUnset(request.epCertNo)) {
    query['EpCertNo'] = request.epCertNo;
  }
  if (!Util.isUnset(request.legalPersonCertName)) {
    query['LegalPersonCertName'] = request.legalPersonCertName;
  }
  if (!Util.isUnset(request.legalPersonCertNo)) {
    query['LegalPersonCertNo'] = request.legalPersonCertNo;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CompanyFourElementsVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether the enterprise name, the business license number, and the name and ID card of the legal representative belong to the same enterprise. The verification is successful only when the preceding four elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to four-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0, 1, or 2.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyFourElementsVerificationRequest
 * @return CompanyFourElementsVerificationResponse
 */
async function companyFourElementsVerification(request: CompanyFourElementsVerificationRequest): CompanyFourElementsVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return companyFourElementsVerificationWithOptions(request, runtime);
}

model CompanyThreeElementsVerificationRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the [My Applications](https://dytns.console.aliyun.com/analysis/apply) page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/overview?spm=a2c4g.608385.0.0.79847f8b3awqUC), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  epCertName?: string(name='EpCertName', description='The enterprise name.

This parameter is required.', example='示例值'),
  epCertNo?: string(name='EpCertNo', description='The business license number.

This parameter is required.', example='9242032*******J627'),
  legalPersonCertName?: string(name='LegalPersonCertName', description='The name of the legal representative.

>  If an enterprise has multiple legal representatives, separate them with commas (,).

This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CompanyThreeElementsVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='-'),
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: {
    detailInfo?: {
      enterpriseStatus?: string(name='EnterpriseStatus', description='The business status of the enterprise.', example='Active'),
      openTime?: string(name='OpenTime', description='The business term of the enterprise.', example='2023-05-25/2053-05-24'),
    }(name='DetailInfo', description='The information about the enterprise.'),
    inconsistentData?: [ string ](name='InconsistentData', description='The fields to be verified.'),
    reasonCode?: long(name='ReasonCode', description='The code of the verification result. Valid values:

*   0: The three elements belong to the same enterprise.
*   1: The three elements belong to the same enterprise, and the business status of the enterprise is abnormal.
*   2: The legal representative information cannot match the enterprise information.
*   3: The three elements do not belong to the same enterprise.
*   4: No information about the enterprise is found.
*   5: No information about the legal representative is found.', example='0'),
    verifyResult?: string(name='VerifyResult', description='The verification result. Valid values:

*   true: The three elements belong to the same enterprise and the business status of the enterprise is Active.
*   false: The three elements do not belong to the same enterprise.', example='true'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='68A40250-50CD-034C-B728-0BD135850177'),
}

model CompanyThreeElementsVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompanyThreeElementsVerificationResponseBody(name='body'),
}

/**
 * @summary Verifies whether the enterprise name, the business license number, and the name of the legal representative belong to the same enterprise. The verification is successful only when the three elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to three-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0, 1, or 2.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyThreeElementsVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompanyThreeElementsVerificationResponse
 */
async function companyThreeElementsVerificationWithOptions(request: CompanyThreeElementsVerificationRequest, runtime: Util.RuntimeOptions): CompanyThreeElementsVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.epCertName)) {
    query['EpCertName'] = request.epCertName;
  }
  if (!Util.isUnset(request.epCertNo)) {
    query['EpCertNo'] = request.epCertNo;
  }
  if (!Util.isUnset(request.legalPersonCertName)) {
    query['LegalPersonCertName'] = request.legalPersonCertName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CompanyThreeElementsVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether the enterprise name, the business license number, and the name of the legal representative belong to the same enterprise. The verification is successful only when the three elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to three-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0, 1, or 2.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyThreeElementsVerificationRequest
 * @return CompanyThreeElementsVerificationResponse
 */
async function companyThreeElementsVerification(request: CompanyThreeElementsVerificationRequest): CompanyThreeElementsVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return companyThreeElementsVerificationWithOptions(request, runtime);
}

model CompanyTwoElementsVerificationRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the [My Applications](https://dytns.console.aliyun.com/analysis/apply) page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/overview?spm=a2c4g.608385.0.0.79847f8b3awqUC), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  epCertName?: string(name='EpCertName', description='The enterprise name.

This parameter is required.', example='示例值示例值'),
  epCertNo?: string(name='EpCertNo', description='The business license number.

This parameter is required.', example='9242032*******J627'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CompanyTwoElementsVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.', example='-'),
  code?: string(name='Code', description='The response code.', example='OK'),
  data?: {
    detailInfo?: {
      enterpriseStatus?: string(name='EnterpriseStatus', description='The business status of the enterprise.', example='Active'),
      openTime?: string(name='OpenTime', description='The business term of the enterprise.', example='2023-05-25/2053-05-24'),
    }(name='DetailInfo', description='The information about the enterprise.'),
    inconsistentData?: [ string ](name='InconsistentData', description='The fields to be verified.'),
    reasonCode?: string(name='ReasonCode', description='The code of the verification result. Valid values:

*   0: The two elements belong to the same enterprise.
*   1: The two elements belong to the same enterprise, but the business status of the enterprise is abnormal.
*   3: The two elements do not belong to the same enterprise.
*   4: No information about the enterprise is found.', example='0'),
    verifyResult?: string(name='VerifyResult', description='The verification result. Valid values:

*   true: The two elements belong to the same enterprise and the business status of the enterprise is Active.
*   false: The two elements do not belong to the same enterprise.', example='true'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='68A40250-50CD-034C-B728-0BD135850177'),
}

model CompanyTwoElementsVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompanyTwoElementsVerificationResponseBody(name='body'),
}

/**
 * @summary Verifies whether the enterprise name and the business license number belong to the same enterprise. The verification is successful only when the two elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to two-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0 or 1.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyTwoElementsVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompanyTwoElementsVerificationResponse
 */
async function companyTwoElementsVerificationWithOptions(request: CompanyTwoElementsVerificationRequest, runtime: Util.RuntimeOptions): CompanyTwoElementsVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.epCertName)) {
    query['EpCertName'] = request.epCertName;
  }
  if (!Util.isUnset(request.epCertNo)) {
    query['EpCertNo'] = request.epCertNo;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CompanyTwoElementsVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether the enterprise name and the business license number belong to the same enterprise. The verification is successful only when the two elements belong to the same enterprise and the business status of the enterprise is Active.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the billing of services related to two-element verification for enterprises. For more information, see [Billing](https://help.aliyun.com/document_detail/154751.html?spm=a2c4g.154007.0.0.3edd7eb6E90YT4).
 * *   You are charged only if the value of VerifyResult is true or false and the value of ReasonCode is 0 or 1.
 * *   Before you call this operation, perform the following operations: Log on to the [Cell Phone Number Service console](https://account.aliyun.com/login/login.htm?oauth_callback=https%3A%2F%2Fdytns.console.aliyun.com%2Foverview%3Fspm%3Da2c4g.608385.0.0.79847f8b3awqUC\\&lang=zh). On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request CompanyTwoElementsVerificationRequest
 * @return CompanyTwoElementsVerificationResponse
 */
async function companyTwoElementsVerification(request: CompanyTwoElementsVerificationRequest): CompanyTwoElementsVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return companyTwoElementsVerificationWithOptions(request, runtime);
}

model DescribeEmptyNumberRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

>  You can query only one phone number a time.

This parameter is required.', example='189****1234'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeEmptyNumberResponseBody = {
  code?: string(name='Code', description='The HTTP status code. Valid values:

*   **OK**: The request is successful.
*   **InvalidPhoneNumber.Check**: The phone number is invalid.', example='OK'),
  data?: {
    number?: string(name='Number', description='The specified phone number.', example='189****1234'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **EMPTY**: The queried phone number is a nonexistent number.
*   **NORMAL**: The queried phone number is valid.
*   **SUSPECT_EMPTY**: The queried phone number is suspected to be a nonexistent number.
*   **UNKNOWN**: The queried phone number is unknown.', example='EMPTY'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model DescribeEmptyNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEmptyNumberResponseBody(name='body'),
}

/**
 * @summary Predicts whether a phone number is a nonexistent number by using AI algorithms.
 *
 * @description *   You can call this operation to verify whether a phone number is a nonexistent number. When you call this operation to verify a number, the system charges you CNY 0.01 per verification based on the number of verifications. **Before you call this operation, make sure that you are familiar with the billing of Cell Phone Number Service.**
 * *   You are charged only if the value of Code is OK and the value of Status is not UNKNOWN.
 * *   The prediction is not strictly accurate because Cell Phone Number Service predicts the nonexistent number probability by using AI algorithms. The accuracy rate of the prediction and the recall rate of empty numbers are about 95%. **Pay attention to this point when you call this operation**.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ### [](#)Authorization information
 * By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 *
 * @param request DescribeEmptyNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEmptyNumberResponse
 */
async function describeEmptyNumberWithOptions(request: DescribeEmptyNumberRequest, runtime: Util.RuntimeOptions): DescribeEmptyNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEmptyNumber',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Predicts whether a phone number is a nonexistent number by using AI algorithms.
 *
 * @description *   You can call this operation to verify whether a phone number is a nonexistent number. When you call this operation to verify a number, the system charges you CNY 0.01 per verification based on the number of verifications. **Before you call this operation, make sure that you are familiar with the billing of Cell Phone Number Service.**
 * *   You are charged only if the value of Code is OK and the value of Status is not UNKNOWN.
 * *   The prediction is not strictly accurate because Cell Phone Number Service predicts the nonexistent number probability by using AI algorithms. The accuracy rate of the prediction and the recall rate of empty numbers are about 95%. **Pay attention to this point when you call this operation**.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ### [](#)Authorization information
 * By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 *
 * @param request DescribeEmptyNumberRequest
 * @return DescribeEmptyNumberResponse
 */
async function describeEmptyNumber(request: DescribeEmptyNumberRequest): DescribeEmptyNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEmptyNumberWithOptions(request, runtime);
}

model DescribeMobileOperatorAttributeRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='示例值示例值示例值'),
  mask?: string(name='Mask', description='This parameter is required.', example='示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeMobileOperatorAttributeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值示例值'),
  data?: {
    basicCarrier?: string(name='BasicCarrier', example='示例值示例值示例值'),
    carrier?: string(name='Carrier', example='示例值'),
    city?: string(name='City', example='示例值示例值'),
    isNumberPortability?: boolean(name='IsNumberPortability', example='true'),
    province?: string(name='Province', example='示例值示例值'),
    realNumber?: string(name='RealNumber', example='示例值示例值'),
    segmentCarrier?: string(name='SegmentCarrier', example='示例值示例值'),
  }(name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  requestId?: string(name='RequestId', example='示例值示例值'),
}

model DescribeMobileOperatorAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMobileOperatorAttributeResponseBody(name='body'),
}

/**
 * @summary 号码归属地查询v2
 *
 * @param request DescribeMobileOperatorAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMobileOperatorAttributeResponse
 */
async function describeMobileOperatorAttributeWithOptions(request: DescribeMobileOperatorAttributeRequest, runtime: Util.RuntimeOptions): DescribeMobileOperatorAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMobileOperatorAttribute',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码归属地查询v2
 *
 * @param request DescribeMobileOperatorAttributeRequest
 * @return DescribeMobileOperatorAttributeResponse
 */
async function describeMobileOperatorAttribute(request: DescribeMobileOperatorAttributeRequest): DescribeMobileOperatorAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMobileOperatorAttributeWithOptions(request, runtime);
}

model DescribePhoneNumberAnalysisRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='QASDW@#**'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='1310000****'),
  mask?: string(name='Mask', example='MD5'),
  numberType?: long(name='NumberType', example='0'),
  ownerId?: long(name='OwnerId'),
  rate?: long(name='Rate', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberAnalysisResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='OK'),
  data?: {
    list?: [ 
      {
        code?: string(name='Code', example='NO'),
        number?: string(name='Number', example='18752785620'),
      }
    ](name='List'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model DescribePhoneNumberAnalysisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberAnalysisResponseBody(name='body'),
}

/**
 * @summary 号码分析实时查询蚂蚁
 *
 * @param request DescribePhoneNumberAnalysisRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberAnalysisResponse
 */
async function describePhoneNumberAnalysisWithOptions(request: DescribePhoneNumberAnalysisRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberAnalysisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.numberType)) {
    query['NumberType'] = request.numberType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.rate)) {
    query['Rate'] = request.rate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberAnalysis',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码分析实时查询蚂蚁
 *
 * @param request DescribePhoneNumberAnalysisRequest
 * @return DescribePhoneNumberAnalysisResponse
 */
async function describePhoneNumberAnalysis(request: DescribePhoneNumberAnalysisRequest): DescribePhoneNumberAnalysisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberAnalysisWithOptions(request, runtime);
}

model DescribePhoneNumberAnalysisAIRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the ****[**Labels**](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click Activate Now, enter the required information, and then submit your application. After your application is approved, you can obtain an authorization code.

This parameter is required.', example='HwD***nG'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

This parameter is required.', example='187****5620'),
  modelConfig?: string(name='ModelConfig', description='The model parameter configuration. This field is required by some labels.', example='{"trainingJobId": "17**********48"}'),
  ownerId?: long(name='OwnerId'),
  rate?: long(name='Rate', description='The score threshold for the phone number. Valid values: **0 to 100**.

>  The system provided by Alibaba Cloud determines whether to accept the specified score threshold. When the system does not accept the specified score threshold, the value of this field is invalid.', example='96'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberAnalysisAIResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', description='The response code. Valid values:

*   OK: The request is successful.', example='OK'),
  data?: {
    code?: string(name='Code', description='The returned code.

*   YES: The specified phone number is valid.
*   NO: The specified phone number is invalid.
*   UNKNOWN: The specified phone number is unknown', example='YES'),
    number?: string(name='Number', description='The specified phone number.', example='187****5620'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='68A40250-50CD-034C-B728-0BD******177'),
}

model DescribePhoneNumberAnalysisAIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberAnalysisAIResponseBody(name='body'),
}

/**
 * @summary Obtains the analysis results of a phone number.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the Labels page, find the label that you want to use, click Activate Now, enter the required information, and then submit your application. After your application is approved, you can use the label. Before you call this operation, make sure that you are familiar with the billing of Cell Phone Number Service.
 *
 * @param request DescribePhoneNumberAnalysisAIRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberAnalysisAIResponse
 */
async function describePhoneNumberAnalysisAIWithOptions(request: DescribePhoneNumberAnalysisAIRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberAnalysisAIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.modelConfig)) {
    query['ModelConfig'] = request.modelConfig;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.rate)) {
    query['Rate'] = request.rate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberAnalysisAI',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the analysis results of a phone number.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the Labels page, find the label that you want to use, click Activate Now, enter the required information, and then submit your application. After your application is approved, you can use the label. Before you call this operation, make sure that you are familiar with the billing of Cell Phone Number Service.
 *
 * @param request DescribePhoneNumberAnalysisAIRequest
 * @return DescribePhoneNumberAnalysisAIResponse
 */
async function describePhoneNumberAnalysisAI(request: DescribePhoneNumberAnalysisAIRequest): DescribePhoneNumberAnalysisAIResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberAnalysisAIWithOptions(request, runtime);
}

model DescribePhoneNumberAnalysisPaiRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值示例值示例值'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='示例值示例值'),
  modelConfig?: string(name='ModelConfig', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  rate?: long(name='Rate', example='16'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberAnalysisPaiResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值'),
  data?: [ string ](name='Data'),
  message?: string(name='Message', example='示例值示例值'),
  requestId?: string(name='RequestId', example='示例值示例值示例值'),
}

model DescribePhoneNumberAnalysisPaiResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberAnalysisPaiResponseBody(name='body'),
}

/**
 * @summary 号码分析服务pai供应商批量查询接口
 *
 * @param request DescribePhoneNumberAnalysisPaiRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberAnalysisPaiResponse
 */
async function describePhoneNumberAnalysisPaiWithOptions(request: DescribePhoneNumberAnalysisPaiRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberAnalysisPaiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.modelConfig)) {
    query['ModelConfig'] = request.modelConfig;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.rate)) {
    query['Rate'] = request.rate;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberAnalysisPai',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码分析服务pai供应商批量查询接口
 *
 * @param request DescribePhoneNumberAnalysisPaiRequest
 * @return DescribePhoneNumberAnalysisPaiResponse
 */
async function describePhoneNumberAnalysisPai(request: DescribePhoneNumberAnalysisPaiRequest): DescribePhoneNumberAnalysisPaiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberAnalysisPaiWithOptions(request, runtime);
}

model DescribePhoneNumberAnalysisTransparentRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='QASDW@#**'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='187****5620'),
  ip?: string(name='Ip', example='示例值示例值示例值'),
  numberType?: string(name='NumberType', description='This parameter is required.', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberAnalysisTransparentResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='-'),
  code?: string(name='Code', example='OK'),
  data?: {
    deviceRisk?: string(name='Device_risk', example='示例值示例值示例值'),
    ipRisk?: string(name='Ip_risk', example='示例值示例值'),
    score1?: string(name='Score1', example='0.6'),
    score2?: string(name='Score2', example='0.2'),
    score3?: string(name='Score3', example='0.8'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model DescribePhoneNumberAnalysisTransparentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberAnalysisTransparentResponseBody(name='body'),
}

/**
 * @summary 泛行业人群筛选
 *
 * @param request DescribePhoneNumberAnalysisTransparentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberAnalysisTransparentResponse
 */
async function describePhoneNumberAnalysisTransparentWithOptions(request: DescribePhoneNumberAnalysisTransparentRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberAnalysisTransparentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.numberType)) {
    query['NumberType'] = request.numberType;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberAnalysisTransparent',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 泛行业人群筛选
 *
 * @param request DescribePhoneNumberAnalysisTransparentRequest
 * @return DescribePhoneNumberAnalysisTransparentResponse
 */
async function describePhoneNumberAnalysisTransparent(request: DescribePhoneNumberAnalysisTransparentRequest): DescribePhoneNumberAnalysisTransparentResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberAnalysisTransparentWithOptions(request, runtime);
}

model DescribePhoneNumberAttributeRequest {
  ownerId?: long(name='OwnerId'),
  phoneNumber?: string(name='PhoneNumber', description='The phone number that you want to query.

This parameter is required.', example='1390000****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberAttributeResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **InvalidParameter**: The specified phone number is invalid or the parameter format is invalid.
*   **PhoneNumberNotfound**: No attribute information can be found for the specified phone number.
*   **isp.UNKNOWN**: An unknown exception occurred.', example='OK'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  phoneNumberAttribute?: {
    basicCarrier?: string(name='BasicCarrier', description='The basic carrier. Valid values:

*   **China Mobile**
*   **China Unicom**
*   **China Telecom**'),
    carrier?: string(name='Carrier', description='The actual carrier, including the virtual network operator (VNO). If the phone number involves mobile number portability, the value of this parameter is the carrier after mobile number portability.'),
    city?: string(name='City', description='The city where the phone number is registered.'),
    isNumberPortability?: boolean(name='IsNumberPortability', description='Indicates whether the phone number involves mobile number portability. Valid values:

*   **true**
*   **false**', example='false'),
    numberSegment?: long(name='NumberSegment', description='The number segment to which the phone number belongs.', example='139'),
    province?: string(name='Province', description='The province where the phone number is registered.'),
  }(name='PhoneNumberAttribute', description='The attribute information about the phone number.'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model DescribePhoneNumberAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberAttributeResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI DescribePhoneNumberAttribute is deprecated, please use Dytnsapi::2020-02-17::DescribePhoneNumberOperatorAttribute instead.
 *
 * @summary Queries the carrier, registration location, and mobile number portability information of a phone number.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 2,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribePhoneNumberAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberAttributeResponse
 */
// Deprecated
async function describePhoneNumberAttributeWithOptions(request: DescribePhoneNumberAttributeRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.phoneNumber)) {
    query['PhoneNumber'] = request.phoneNumber;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberAttribute',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI DescribePhoneNumberAttribute is deprecated, please use Dytnsapi::2020-02-17::DescribePhoneNumberOperatorAttribute instead.
 *
 * @summary Queries the carrier, registration location, and mobile number portability information of a phone number.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * ### [](#qps)QPS limits
 * You can call this operation up to 2,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribePhoneNumberAttributeRequest
 * @return DescribePhoneNumberAttributeResponse
 */
// Deprecated
async function describePhoneNumberAttribute(request: DescribePhoneNumberAttributeRequest): DescribePhoneNumberAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberAttributeWithOptions(request, runtime);
}

model DescribePhoneNumberOnlineTimeRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='QASDW@#**'),
  carrier?: string(name='Carrier', description='The carrier. Valid values:

*   **MOBILE**: China Mobile
*   **UNICOM**: China Unicom
*   **TELECOM**: China Telecom

>  Alibaba Cloud automatically determines the carrier based on the carrier who assigns the phone number. Therefore, the value of this field does not affect the query result.', example='UNICOM'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='1390000****'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberOnlineTimeResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **PortabilityNumberNotSupported**: The phone number that is involved in mobile number portability is not supported.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.

>  You are charged if the value of Code is OK and the value of VerifyResult is not -1. For more information, see [Pricing](https://help.aliyun.com/document_detail/154751.html).', example='OK'),
  data?: {
    carrierCode?: string(name='CarrierCode', description='The carrier code. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom
*   **CBN**: China Broadnet', example='CMCC'),
    verifyResult?: string(name='VerifyResult', description='The enumerated value of the usage period of a phone number. Valid values:

*   **-1**: No usage period information is available for the phone number.
*   **0**: The phone number status is abnormal. For example, the phone number is a nonexistent number.
*   **1** :[0-3) months.
*   **2** :[3-6] months.
*   **3** :(6-12] months.
*   **4** :(12-24] months.
*   **5** :(24,+) months.', example='1'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model DescribePhoneNumberOnlineTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberOnlineTimeResponseBody(name='body'),
}

/**
 * @summary Queries the usage period of a phone number of a user.
 *
 * @description *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribePhoneNumberOnlineTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberOnlineTimeResponse
 */
async function describePhoneNumberOnlineTimeWithOptions(request: DescribePhoneNumberOnlineTimeRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberOnlineTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberOnlineTime',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the usage period of a phone number of a user.
 *
 * @description *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request DescribePhoneNumberOnlineTimeRequest
 * @return DescribePhoneNumberOnlineTimeResponse
 */
async function describePhoneNumberOnlineTime(request: DescribePhoneNumberOnlineTimeRequest): DescribePhoneNumberOnlineTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberOnlineTimeWithOptions(request, runtime);
}

model DescribePhoneNumberOperatorAttributeRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  flowName?: string(name='FlowName', example='示例值'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='139****1234'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**: The phone number is MD5-encrypted.
*   **SHA256**: The phone number is SHA256-encrypted.

> Letters in the string must be uppercase.

This parameter is required.', example='MD5'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resultCount?: string(name='ResultCount', example='示例值示例值示例值'),
}

model DescribePhoneNumberOperatorAttributeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **InvalidParameter**: The specified phone number is invalid or the parameter format is invalid.
*   **PhoneNumberNotfound**: No attribute information can be found for the specified phone number.
*   **isp.UNKNOWN**: An unknown exception occurred.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    basicCarrier?: string(name='BasicCarrier', description='The basic carrier. Valid values:

*   **China Mobile**
*   **China Unicom**
*   **China Telecom**
*   **China Broadnet**', example='China Mobile'),
    carrier?: string(name='Carrier', description='The actual carrier, including the virtual network operator (VNO). If the phone number involves mobile number portability, the value of this parameter is the carrier after mobile number portability.', example='China Mobile'),
    city?: string(name='City', description='The city where the phone number is registered.', example='hangzhou'),
    isNumberPortability?: boolean(name='IsNumberPortability', description='Indicates whether the phone number involves mobile number portability. Valid values:

*   **true**
*   **false**', example='false'),
    numberSegment?: long(name='NumberSegment', description='The number segment to which the phone number belongs.', example='139'),
    province?: string(name='Province', description='The province where the phone number is registered.', example='zhejiang'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='68A40250-50CD-034C-B728-0BD135850177'),
}

model DescribePhoneNumberOperatorAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberOperatorAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the attribute information about a phone number, including the registration province, registration city, basic carrier (such as China Mobile, China Unicom, China Telecom, or China Broadnet), reseller of mobile communications services (such as Alibaba Communications), mobile number portability, and the number segment to which the phone number belongs.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154008.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   You can call this operation to obtain the carrier, registration location, and mobile number portability information about a phone number. You can query phone numbers in **plaintext** and phone numbers that are encrypted by using **MD5** and **SHA256**.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request DescribePhoneNumberOperatorAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberOperatorAttributeResponse
 */
async function describePhoneNumberOperatorAttributeWithOptions(request: DescribePhoneNumberOperatorAttributeRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberOperatorAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.flowName)) {
    query['FlowName'] = request.flowName;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resultCount)) {
    query['ResultCount'] = request.resultCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberOperatorAttribute',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the attribute information about a phone number, including the registration province, registration city, basic carrier (such as China Mobile, China Unicom, China Telecom, or China Broadnet), reseller of mobile communications services (such as Alibaba Communications), mobile number portability, and the number segment to which the phone number belongs.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154008.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   You can call this operation to obtain the carrier, registration location, and mobile number portability information about a phone number. You can query phone numbers in **plaintext** and phone numbers that are encrypted by using **MD5** and **SHA256**.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 *
 * @param request DescribePhoneNumberOperatorAttributeRequest
 * @return DescribePhoneNumberOperatorAttributeResponse
 */
async function describePhoneNumberOperatorAttribute(request: DescribePhoneNumberOperatorAttributeRequest): DescribePhoneNumberOperatorAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberOperatorAttributeWithOptions(request, runtime);
}

model DescribePhoneNumberOperatorAttributeAnnualRequest {
  authCode?: string(name='AuthCode'),
  mask?: string(name='Mask'),
  number?: string(name='Number'),
}

model DescribePhoneNumberOperatorAttributeAnnualResponseBody = {
  code?: string(name='Code'),
  data?: {
    basicCarrier?: string(name='BasicCarrier'),
    carrier?: string(name='Carrier'),
    city?: string(name='City'),
    mts?: string(name='Mts'),
    numberPortability?: boolean(name='NumberPortability'),
    province?: string(name='Province'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribePhoneNumberOperatorAttributeAnnualResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberOperatorAttributeAnnualResponseBody(name='body'),
}

/**
 * @summary 号码归属服务(包年包月客户专用)
 *
 * @param request DescribePhoneNumberOperatorAttributeAnnualRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberOperatorAttributeAnnualResponse
 */
async function describePhoneNumberOperatorAttributeAnnualWithOptions(request: DescribePhoneNumberOperatorAttributeAnnualRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberOperatorAttributeAnnualResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.number)) {
    query['Number'] = request.number;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberOperatorAttributeAnnual',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码归属服务(包年包月客户专用)
 *
 * @param request DescribePhoneNumberOperatorAttributeAnnualRequest
 * @return DescribePhoneNumberOperatorAttributeAnnualResponse
 */
async function describePhoneNumberOperatorAttributeAnnual(request: DescribePhoneNumberOperatorAttributeAnnualRequest): DescribePhoneNumberOperatorAttributeAnnualResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberOperatorAttributeAnnualWithOptions(request, runtime);
}

model DescribePhoneNumberOperatorAttributeAnnualUseRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.'),
  mask?: string(name='Mask', description='This parameter is required.'),
}

model DescribePhoneNumberOperatorAttributeAnnualUseResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code'),
  data?: {
    basicCarrier?: string(name='BasicCarrier'),
    carrier?: string(name='Carrier'),
    city?: string(name='City'),
    isNumberPortability?: boolean(name='IsNumberPortability'),
    numberSegment?: long(name='NumberSegment'),
    province?: string(name='Province'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribePhoneNumberOperatorAttributeAnnualUseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberOperatorAttributeAnnualUseResponseBody(name='body'),
}

/**
 * @summary 号码归属服务(包年包月客户专用)
 *
 * @param request DescribePhoneNumberOperatorAttributeAnnualUseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberOperatorAttributeAnnualUseResponse
 */
async function describePhoneNumberOperatorAttributeAnnualUseWithOptions(request: DescribePhoneNumberOperatorAttributeAnnualUseRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberOperatorAttributeAnnualUseResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberOperatorAttributeAnnualUse',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码归属服务(包年包月客户专用)
 *
 * @param request DescribePhoneNumberOperatorAttributeAnnualUseRequest
 * @return DescribePhoneNumberOperatorAttributeAnnualUseResponse
 */
async function describePhoneNumberOperatorAttributeAnnualUse(request: DescribePhoneNumberOperatorAttributeAnnualUseRequest): DescribePhoneNumberOperatorAttributeAnnualUseResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberOperatorAttributeAnnualUseWithOptions(request, runtime);
}

model DescribePhoneNumberRiskRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='示例值示例值'),
  mask?: string(name='Mask', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePhoneNumberRiskResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code'),
  data?: {
    verifyResult?: string(name='VerifyResult', example='示例值'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DescribePhoneNumberRiskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneNumberRiskResponseBody(name='body'),
}

/**
 * @summary 风险用户评分
 *
 * @param request DescribePhoneNumberRiskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneNumberRiskResponse
 */
async function describePhoneNumberRiskWithOptions(request: DescribePhoneNumberRiskRequest, runtime: Util.RuntimeOptions): DescribePhoneNumberRiskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneNumberRisk',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 风险用户评分
 *
 * @param request DescribePhoneNumberRiskRequest
 * @return DescribePhoneNumberRiskResponse
 */
async function describePhoneNumberRisk(request: DescribePhoneNumberRiskRequest): DescribePhoneNumberRiskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneNumberRiskWithOptions(request, runtime);
}

model DescribePhoneTwiceTelVerifyRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='139*******'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The registration time. Specify the time in the yyyy-MM-dd HH:mm:ss format. This time is the service registration time of the mobile phone user. If the service registration time is later than the time when the phone number is assigned by a carrier, it indicates that the phone number is not a reassigned number. Otherwise, the phone number is a reassigned number.

> 

*   If a carrier allocates a single number multiple times, the system will determine whether the phone number is a reassigned number based on the time when the carrier last allocated the phone number.

*   The service registration time must be later than 00:00:00 on January 1, 1970.

This parameter is required.', example='2018-01-01 00:00:00'),
}

model DescribePhoneTwiceTelVerifyResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **PortabilityNumberNotSupported**: The phone number that is involved in mobile number portability is not supported.
*   **RequestNumberNotSupported**: You are not allowed to query phone numbers assigned by China Broadnet (that is, phone numbers start with 192) and phone numbers assigned by virtual network operators (VNOs).
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.

>  You are charged for phone number verifications if the value of Code is OK and the value of VerifyResult is not 0. For more information, see [Pricing](https://help.aliyun.com/document_detail/154751.html).', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The carrier. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  The returned result indicates the carrier who assigns the phone number. If the phone number involves mobile number portability, the carrier after mobile number portability is returned.', example='CMCC'),
    verifyResult?: string(name='VerifyResult', description='The result of the request. Valid values:

*   **0**: It is unable to judge whether the phone number is a reassigned number.
*   **1**: The phone number is a reassigned number.
*   **2**: The phone number is not a reassigned number.
*   **3**: The phone number has been canceled.', example='1'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot and locate issues.', example='68A40250-50CD-034C-B728-0BD135850177'),
}

model DescribePhoneTwiceTelVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePhoneTwiceTelVerifyResponseBody(name='body'),
}

/**
 * @summary Verifies whether a phone number is a reassigned phone number by calling this operation.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   You are charged for phone number verifications only if the value of Code is OK and the value of VerifyResult is not 0.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ## [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ## [](#)Authorization information
 * By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 *
 * @param request DescribePhoneTwiceTelVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePhoneTwiceTelVerifyResponse
 */
async function describePhoneTwiceTelVerifyWithOptions(request: DescribePhoneTwiceTelVerifyRequest, runtime: Util.RuntimeOptions): DescribePhoneTwiceTelVerifyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePhoneTwiceTelVerify',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether a phone number is a reassigned phone number by calling this operation.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   You are charged for phone number verifications only if the value of Code is OK and the value of VerifyResult is not 0.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ## [](#qps)QPS limits
 * You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 * ## [](#)Authorization information
 * By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 *
 * @param request DescribePhoneTwiceTelVerifyRequest
 * @return DescribePhoneTwiceTelVerifyResponse
 */
async function describePhoneTwiceTelVerify(request: DescribePhoneTwiceTelVerifyRequest): DescribePhoneTwiceTelVerifyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePhoneTwiceTelVerifyWithOptions(request, runtime);
}

model GetUAIDApplyTokenSignRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='HwD97InG'),
  carrier?: string(name='Carrier', description='This parameter is required.', example='CM'),
  clientType?: string(name='ClientType', description='This parameter is required.', example='30300'),
  format?: string(name='Format', example='示例值示例值'),
  outId?: string(name='OutId', description='This parameter is required.', example='b8b5b3a*******0b9893484fdf412c99'),
  ownerId?: long(name='OwnerId'),
  paramKey?: string(name='ParamKey', example='955EC1A869852EA8BC66F********D7C6E92017BBD5B001C736EFEAFB775C232'),
  paramStr?: string(name='ParamStr', example='B2F0D4CD7A216D16CE2AF4BBC********29A454FDDD991F919106C12CB89ABA8'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  time?: string(name='Time', description='This parameter is required.', example='20121227180001165'),
}

model GetUAIDApplyTokenSignResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='-'),
  code?: string(name='Code', example='OK'),
  data?: {
    carrier?: string(name='Carrier', example='CM'),
    outId?: string(name='OutId', example='b8b5b3a*******0b9893484fdf412c99'),
    sign?: string(name='Sign', example='D2E204D74EEB373E468632********23F592C4C9'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='68A40250-50CD-034C-B728-0BD******177'),
}

model GetUAIDApplyTokenSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUAIDApplyTokenSignResponseBody(name='body'),
}

/**
 * @summary 获取UAID申请Token所需的签名字段
 *
 * @param request GetUAIDApplyTokenSignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUAIDApplyTokenSignResponse
 */
async function getUAIDApplyTokenSignWithOptions(request: GetUAIDApplyTokenSignRequest, runtime: Util.RuntimeOptions): GetUAIDApplyTokenSignResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!Util.isUnset(request.format)) {
    query['Format'] = request.format;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.paramKey)) {
    query['ParamKey'] = request.paramKey;
  }
  if (!Util.isUnset(request.paramStr)) {
    query['ParamStr'] = request.paramStr;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.time)) {
    query['Time'] = request.time;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUAIDApplyTokenSign',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取UAID申请Token所需的签名字段
 *
 * @param request GetUAIDApplyTokenSignRequest
 * @return GetUAIDApplyTokenSignResponse
 */
async function getUAIDApplyTokenSign(request: GetUAIDApplyTokenSignRequest): GetUAIDApplyTokenSignResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUAIDApplyTokenSignWithOptions(request, runtime);
}

model GetUAIDConversionSignRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值示例值'),
  carrier?: string(name='Carrier', description='This parameter is required.', example='示例值示例值示例值'),
  clientType?: string(name='ClientType', example='示例值'),
  format?: string(name='Format', example='示例值示例值示例值'),
  outId?: string(name='OutId', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  paramKey?: string(name='ParamKey', example='示例值示例值'),
  paramStr?: string(name='ParamStr', example='示例值示例值'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  time?: string(name='Time', example='示例值示例值'),
}

model GetUAIDConversionSignResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code'),
  data?: {
    carrier?: string(name='Carrier', example='示例值示例值示例值'),
    outId?: string(name='OutId', example='示例值示例值'),
    sign?: string(name='Sign', example='示例值'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetUAIDConversionSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUAIDConversionSignResponseBody(name='body'),
}

/**
 * @summary 获取号码采集服务申请Token所需的签名字段
 *
 * @param request GetUAIDConversionSignRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUAIDConversionSignResponse
 */
async function getUAIDConversionSignWithOptions(request: GetUAIDConversionSignRequest, runtime: Util.RuntimeOptions): GetUAIDConversionSignResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.clientType)) {
    query['ClientType'] = request.clientType;
  }
  if (!Util.isUnset(request.format)) {
    query['Format'] = request.format;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.paramKey)) {
    query['ParamKey'] = request.paramKey;
  }
  if (!Util.isUnset(request.paramStr)) {
    query['ParamStr'] = request.paramStr;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.time)) {
    query['Time'] = request.time;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUAIDConversionSign',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取号码采集服务申请Token所需的签名字段
 *
 * @param request GetUAIDConversionSignRequest
 * @return GetUAIDConversionSignResponse
 */
async function getUAIDConversionSign(request: GetUAIDConversionSignRequest): GetUAIDConversionSignResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUAIDConversionSignWithOptions(request, runtime);
}

model InvalidPhoneNumberFilterRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='QASDW@#**'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

This parameter is required.', example='1390000****'),
  mask?: string(name='Mask', description='The encryption method of the phone number.

>  Only the NORMAL encryption method is supported.

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model InvalidPhoneNumberFilterResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **MobileNumberIllegal**: The phone number is invalid.
*   **EncyrptTypeIllegal**: The encryption type is invalid.
*   **MobileNumberTypeNotMatch**: The phone number does not match the encryption type.
*   **CarrierIllegal**: The carrier type is invalid.
*   **AuthCodeNotExist**: The authorization code does not exist.
*   **PortabilityNumberNotSupported**: Mobile number portability is not supported.
*   **Unknown**: An unknown exception occurred.
*   **AuthCodeAndApiNotMatch**: A system exception occurred.
*   **AuthCodeAndApiNotMatch**: The authorization code does not match the API operation.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: [ 
    {
      code?: string(name='Code', description='The returned filter results.

*   **YES**: the valid phone number. The mappings are returned.
*   **NO**: the invalid phone number. No mappings are returned.', example='YES'),
      encryptedNumber?: string(name='EncryptedNumber', description='The encrypted phone number.', example='1400513****'),
      expireTime?: string(name='ExpireTime', description='The time when the phone number expires.', example='2022-05-27 16:05:23'),
      originalNumber?: string(name='OriginalNumber', description='The original phone number.', example='1390000****'),
    }
  ](name='Data', description='Details about the returned entries.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model InvalidPhoneNumberFilterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InvalidPhoneNumberFilterResponseBody(name='body'),
}

/**
 * @summary Filters invalid phone numbers.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request InvalidPhoneNumberFilterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InvalidPhoneNumberFilterResponse
 */
async function invalidPhoneNumberFilterWithOptions(request: InvalidPhoneNumberFilterRequest, runtime: Util.RuntimeOptions): InvalidPhoneNumberFilterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InvalidPhoneNumberFilter',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Filters invalid phone numbers.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request InvalidPhoneNumberFilterRequest
 * @return InvalidPhoneNumberFilterResponse
 */
async function invalidPhoneNumberFilter(request: InvalidPhoneNumberFilterRequest): InvalidPhoneNumberFilterResponse {
  var runtime = new Util.RuntimeOptions{};
  return invalidPhoneNumberFilterWithOptions(request, runtime);
}

model PhoneNumberConvertServiceRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.'),
  mask?: string(name='Mask', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberConvertServiceResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      converResult?: boolean(name='ConverResult'),
      number?: string(name='Number'),
      numberMd5?: string(name='NumberMd5'),
      numberSha256?: string(name='NumberSha256'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model PhoneNumberConvertServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberConvertServiceResponseBody(name='body'),
}

/**
 * @param request PhoneNumberConvertServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberConvertServiceResponse
 */
async function phoneNumberConvertServiceWithOptions(request: PhoneNumberConvertServiceRequest, runtime: Util.RuntimeOptions): PhoneNumberConvertServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberConvertService',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request PhoneNumberConvertServiceRequest
 * @return PhoneNumberConvertServiceResponse
 */
async function phoneNumberConvertService(request: PhoneNumberConvertServiceRequest): PhoneNumberConvertServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberConvertServiceWithOptions(request, runtime);
}

model PhoneNumberEncryptRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='QASDW@#**'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

>  You can query only one phone number at a time.

This parameter is required.', example='1390000****'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Set the value to **NORMAL**.

>  Only the NORMAL encryption method is supported.

This parameter is required.', example='NORMAL'),
  outId?: string(name='OutId'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberEncryptResponseBody = {
  code?: string(name='Code', description='The response code.

*   The value OK indicates that the request was successful.
*   Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/109196.html).', example='OK'),
  data?: [ 
    {
      encryptedNumber?: string(name='EncryptedNumber', description='The encrypted phone number.', example='1400513****'),
      expireTime?: string(name='ExpireTime', description='The time when the phone number expires.', example='2022-05-27 16:05:23'),
      originalNumber?: string(name='OriginalNumber', description='The original phone number.', example='1390000****'),
      outId?: string(name='OutId'),
    }
  ](name='Data', description='Details about the returned entries.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model PhoneNumberEncryptResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberEncryptResponseBody(name='body'),
}

/**
 * @summary Encrypts the original phone number into a virtual number that starts with 140. Cell Phone Number Service integrates the communications services provided by Alibaba Cloud. This allows you to initiate a call by using a virtual number that starts with 140.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberEncryptRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberEncryptResponse
 */
async function phoneNumberEncryptWithOptions(request: PhoneNumberEncryptRequest, runtime: Util.RuntimeOptions): PhoneNumberEncryptResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberEncrypt',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Encrypts the original phone number into a virtual number that starts with 140. Cell Phone Number Service integrates the communications services provided by Alibaba Cloud. This allows you to initiate a call by using a virtual number that starts with 140.
 *
 * @description Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberEncryptRequest
 * @return PhoneNumberEncryptResponse
 */
async function phoneNumberEncrypt(request: PhoneNumberEncryptRequest): PhoneNumberEncryptResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberEncryptWithOptions(request, runtime);
}

model PhoneNumberStatusForAccountRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='139****1234'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberStatusForAccountResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **OperatorLimit**: The carrier prohibits the query of the phone number.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The basic carrier who assings the phone number. If the queried phone number involves mobile number portability, the carrier after mobile number portability is returned. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  You are not allowed to query the phone numbers assigned by China Broadnet.', example='CMCC'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **NORMAL**: The queried phone number is valid.
*   **SHUTDOWN**: The queried phone number is suspended.
*   **POWER_OFF**: The queried phone number cannot be connected.
*   **NOT_EXIST**: The queried phone number is a nonexistent number.
*   **DEFECT**: The queried phone number is invalid.
*   **UNKNOWN**: The queried phone number is unknown.

>  Due to system adjustment of the carrier, the BUSY and POWER_OFF states cannot be returned for the numbers assigned by China Telecom. [For more information, see the official announcements](https://help.aliyun.com/document_detail/2489709.html).', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model PhoneNumberStatusForAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberStatusForAccountResponseBody(name='body'),
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberStatusForAccountResponse
 */
async function phoneNumberStatusForAccountWithOptions(request: PhoneNumberStatusForAccountRequest, runtime: Util.RuntimeOptions): PhoneNumberStatusForAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberStatusForAccount',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForAccountRequest
 * @return PhoneNumberStatusForAccountResponse
 */
async function phoneNumberStatusForAccount(request: PhoneNumberStatusForAccountRequest): PhoneNumberStatusForAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberStatusForAccountWithOptions(request, runtime);
}

model PhoneNumberStatusForPublicRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization ID.

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, the value of this field is an 11-digit phone number.
*   If the value of Mask is MD5, the value of this field is a 32-bit encrypted string.
*   If the value of Mask is SHA256, the value of this field is a 64-bit encrypted string.

>  Letters in the encrypted strings are not case-sensitive.', example='139****1234'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberStatusForPublicResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **OperatorLimit**: The carrier prohibits the query of the phone number.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.

>  For a list of error codes, see [Service error codes](https://next.api.aliyun.com/document/Dytnsapi/2020-02-17/errorCode).', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The basic carrier who assigns the phone number. If the queried phone number involves mobile number portability, the carrier after mobile number portability is returned.

Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  You are not allowed to query the phone numbers assigned by China Broadnet.', example='CMCC'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **NORMAL**: The queried phone number can be reached.
*   **SHUTDOWN**: The queried phone number is suspended.
*   **POWER_OFF**: The phone is powered off.
*   **NOT_EXIST**: The queried phone number is a nonexistent number.
*   **SUSPECTED_POWER_OFF**: The phone is suspected to be powered off.
*   **BUSY**: The queried phone number is busy.
*   **UNKNOWN**: The queried phone number is unknown.

>  Due to system adjustment of the carrier, the BUSY and POWER_OFF states cannot be returned for the numbers assigned by China Telecom. [For more information, see the official announcements](https://help.aliyun.com/document_detail/2489709.html).', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-****-****-9DCE-B38165CE4C47'),
}

model PhoneNumberStatusForPublicResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberStatusForPublicResponseBody(name='body'),
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForPublicRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberStatusForPublicResponse
 */
async function phoneNumberStatusForPublicWithOptions(request: PhoneNumberStatusForPublicRequest, runtime: Util.RuntimeOptions): PhoneNumberStatusForPublicResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberStatusForPublic',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForPublicRequest
 * @return PhoneNumberStatusForPublicResponse
 */
async function phoneNumberStatusForPublic(request: PhoneNumberStatusForPublicRequest): PhoneNumberStatusForPublicResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberStatusForPublicWithOptions(request, runtime);
}

model PhoneNumberStatusForRealRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization ID.

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, the value of this field is an 11-digit phone number.
*   If the value of Mask is MD5, the value of this field is a 32-bit encrypted string.
*   If the value of Mask is SHA256, the value of this field is a 64-bit encrypted string.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='189****8999'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberStatusForRealResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **OperatorLimit**: The carrier prohibits the query of the phone number.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The basic carrier who assigns the phone number. If the queried phone number involves mobile number portability, the carrier after mobile number portability is returned. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  You are not allowed to query the phone numbers assigned by China Broadnet.', example='CMCC'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **NORMAL**: The queried phone number can be reached.
*   **SHUTDOWN**: The queried phone number is suspended.
*   **POWER_OFF**: The phone is powered off.
*   **NOT_EXIST**: The queried phone number is a nonexistent number.
*   **BUSY**: The queried phone number is busy.
*   **SUSPECTED_POWER_OFF**: The phone is suspected to be powered off.
*   **DEFECT**: The queried phone number is invalid.
*   **UNKNOWN**: The queried phone number is unknown.

>  Due to system adjustment of the carrier, the BUSY and POWER_OFF states cannot be returned for the numbers assigned by China Telecom. [For more information, see the official announcements](https://help.aliyun.com/document_detail/2489709.html).', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model PhoneNumberStatusForRealResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberStatusForRealResponseBody(name='body'),
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForRealRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberStatusForRealResponse
 */
async function phoneNumberStatusForRealWithOptions(request: PhoneNumberStatusForRealRequest, runtime: Util.RuntimeOptions): PhoneNumberStatusForRealResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberStatusForReal',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForRealRequest
 * @return PhoneNumberStatusForRealResponse
 */
async function phoneNumberStatusForReal(request: PhoneNumberStatusForRealRequest): PhoneNumberStatusForRealResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberStatusForRealWithOptions(request, runtime);
}

model PhoneNumberStatusForSmsRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='zf08***pi6'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='181****1234'),
  mask?: string(name='Mask', description='The encryption method of the phone number. Valid values:

*   **NORMAL**: plaintext
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberStatusForSmsResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **OperatorLimit**: The carrier prohibits the query of the phone number.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The basic carrier who assigns the phone number. If the queried phone number involves mobile number portability, the carrier after mobile number portability is returned. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  You are not allowed to query the phone numbers assigned by China Broadnet.', example='CMCC'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **NORMAL**: The queried phone number can be reached.
*   **SHUTDOWN**: The queried phone number is suspended.
*   **POWER_OFF**: The phone is powered off.
*   **NOT_EXIST**: The queried phone number is a nonexistent number.
*   **DEFECT**: The queried phone number is invalid.
*   **UNKNOWN**: The queried phone number is unknown.

>  Due to system adjustment of the carrier, the BUSY, SUSPECTED_POWER_OFF, and POWER_OFF states cannot be returned for the numbers assigned by China Telecom. [For more information, see the official announcements](https://help.aliyun.com/document_detail/2489709.html).', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='68A40250-50CD-034C-B728-0BD135850177'),
}

model PhoneNumberStatusForSmsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberStatusForSmsResponseBody(name='body'),
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForSmsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberStatusForSmsResponse
 */
async function phoneNumberStatusForSmsWithOptions(request: PhoneNumberStatusForSmsRequest, runtime: Util.RuntimeOptions): PhoneNumberStatusForSmsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberStatusForSms',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForSmsRequest
 * @return PhoneNumberStatusForSmsResponse
 */
async function phoneNumberStatusForSms(request: PhoneNumberStatusForSmsRequest): PhoneNumberStatusForSmsResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberStatusForSmsWithOptions(request, runtime);
}

model PhoneNumberStatusForVoiceRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='Dd1r***4id'),
  inputNumber?: string(name='InputNumber', description='The phone number to be queried.

*   If the value of Mask is NORMAL, specify an 11-digit phone number in plaintext.
*   If the value of Mask is MD5, specify a 32-bit string that is encrypted by using MD5.
*   If the value of Mask is SHA256, specify a 64-bit string that is encrypted by using SHA256.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='139****1234'),
  mask?: string(name='Mask', description='The encryption method. Valid values:

*   **NORMAL**: plaintext
*   **MD5**
*   **SHA256**

This parameter is required.', example='NORMAL'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model PhoneNumberStatusForVoiceResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   **OperatorLimit**: The carrier prohibits the query of the phone number.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    carrier?: string(name='Carrier', description='The basic carrier who assigns the phone number. If the queried phone number involves mobile number portability, the carrier after mobile number portability is returned. Valid values:

*   **CMCC**: China Mobile
*   **CUCC**: China Unicom
*   **CTCC**: China Telecom

>  You are not allowed to query the phone numbers assigned by China Broadnet.', example='CTCC'),
    status?: string(name='Status', description='The returned status for the queried phone number. Valid values:

*   **NORMAL**: The queried phone number can be reached.
*   **SHUTDOWN**: The queried phone number is suspended.
*   **POWER_OFF**: The phone is powered off.
*   **NOT_EXIST**: The queried phone number is a nonexistent number.
*   **SUSPECTED_POWER_OFF**: The phone is suspected to be powered off.
*   **DEFECT**: The queried phone number is invalid.
*   **UNKNOWN**: The queried phone number is unknown.

>  Due to system adjustment of the carrier, the BUSY, SUSPECTED_POWER_OFF, and POWER_OFF states cannot be returned for the numbers assigned by China Telecom. [For more information, see the official announcements](https://help.aliyun.com/document_detail/2489709.html).', example='NORMAL'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The unique request ID. It is a common parameter and can be used to troubleshoot issues.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model PhoneNumberStatusForVoiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PhoneNumberStatusForVoiceResponseBody(name='body'),
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForVoiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PhoneNumberStatusForVoiceResponse
 */
async function phoneNumberStatusForVoiceWithOptions(request: PhoneNumberStatusForVoiceRequest, runtime: Util.RuntimeOptions): PhoneNumberStatusForVoiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PhoneNumberStatusForVoice',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the real-time service state of a phone number. The state includes NORMAL, SHUTDOWN, and NOT_EXIST. You can choose an encryption method for your phone number query, including plaintext, MD5, and SHA256.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after the RAM users are granted the related permissions. For more information, see [Grant permissions to RAM users](https://help.aliyun.com/document_detail/154006.html).
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * ### [](#qps)QPS limits
 * You can call this operation up to 300 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request PhoneNumberStatusForVoiceRequest
 * @return PhoneNumberStatusForVoiceResponse
 */
async function phoneNumberStatusForVoice(request: PhoneNumberStatusForVoiceRequest): PhoneNumberStatusForVoiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return phoneNumberStatusForVoiceWithOptions(request, runtime);
}

model QueryAvailableAuthCodeRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagId?: long(name='TagId', description='The tag ID.', example='22'),
}

model QueryAvailableAuthCodeResponseBody = {
  code?: string(name='Code', description='The response code. **OK** indicates that the request is successful.', example='OK'),
  data?: [ string ](name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='6ADDCD31-6BC7-5913-A47F-E29A07E37FEE'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='false'),
}

model QueryAvailableAuthCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAvailableAuthCodeResponseBody(name='body'),
}

/**
 * @summary Queries available authorization codes.
 *
 * @param request QueryAvailableAuthCodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAvailableAuthCodeResponse
 */
async function queryAvailableAuthCodeWithOptions(request: QueryAvailableAuthCodeRequest, runtime: Util.RuntimeOptions): QueryAvailableAuthCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAvailableAuthCode',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries available authorization codes.
 *
 * @param request QueryAvailableAuthCodeRequest
 * @return QueryAvailableAuthCodeResponse
 */
async function queryAvailableAuthCode(request: QueryAvailableAuthCodeRequest): QueryAvailableAuthCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAvailableAuthCodeWithOptions(request, runtime);
}

model QueryPhoneNumberOnlineTimeRequest {
  authCode?: string(name='AuthCode', example='示例值示例值示例值'),
  inputNumber?: string(name='InputNumber', example='示例值'),
  mask?: string(name='Mask', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryPhoneNumberOnlineTimeResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code'),
  data?: {
    carrierCode?: string(name='CarrierCode', example='示例值示例值示例值'),
    verifyResult?: long(name='VerifyResult', example='29'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model QueryPhoneNumberOnlineTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPhoneNumberOnlineTimeResponseBody(name='body'),
}

/**
 * @summary 在网时长专用接口
 *
 * @param request QueryPhoneNumberOnlineTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPhoneNumberOnlineTimeResponse
 */
async function queryPhoneNumberOnlineTimeWithOptions(request: QueryPhoneNumberOnlineTimeRequest, runtime: Util.RuntimeOptions): QueryPhoneNumberOnlineTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPhoneNumberOnlineTime',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 在网时长专用接口
 *
 * @param request QueryPhoneNumberOnlineTimeRequest
 * @return QueryPhoneNumberOnlineTimeResponse
 */
async function queryPhoneNumberOnlineTime(request: QueryPhoneNumberOnlineTimeRequest): QueryPhoneNumberOnlineTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPhoneNumberOnlineTimeWithOptions(request, runtime);
}

model QueryPhoneTwiceTelVerifyRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值'),
  inputNumber?: string(name='InputNumber', description='This parameter is required.', example='示例值示例值示例值'),
  mask?: string(name='Mask', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='示例值示例值示例值'),
}

model QueryPhoneTwiceTelVerifyResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code'),
  data?: {
    carrierCode?: string(name='CarrierCode', example='示例值示例值'),
    verifyResult?: long(name='VerifyResult', example='73'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model QueryPhoneTwiceTelVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPhoneTwiceTelVerifyResponseBody(name='body'),
}

/**
 * @summary 二次号携号转网号码查询
 *
 * @param request QueryPhoneTwiceTelVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPhoneTwiceTelVerifyResponse
 */
async function queryPhoneTwiceTelVerifyWithOptions(request: QueryPhoneTwiceTelVerifyRequest, runtime: Util.RuntimeOptions): QueryPhoneTwiceTelVerifyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPhoneTwiceTelVerify',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 二次号携号转网号码查询
 *
 * @param request QueryPhoneTwiceTelVerifyRequest
 * @return QueryPhoneTwiceTelVerifyResponse
 */
async function queryPhoneTwiceTelVerify(request: QueryPhoneTwiceTelVerifyRequest): QueryPhoneTwiceTelVerifyResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPhoneTwiceTelVerifyWithOptions(request, runtime);
}

model QueryTagApplyRuleRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagId?: long(name='TagId', description='The tag ID.', example='61'),
}

model QueryTagApplyRuleResponseBody = {
  code?: string(name='Code', description='The response code. **OK** indicates that the request is successful.', example='OK'),
  data?: {
    applyMaterialDesc?: string(name='ApplyMaterialDesc', description='The requirements for application materials.', example='Requirements for application materials'),
    autoAudit?: long(name='AutoAudit', description='Indicates whether the application is automatically approved.', example='16'),
    chargingStandardLink?: string(name='ChargingStandardLink', description='The URL for the billing documentation.', example='aliyundoc.com'),
    encryptedQuery?: long(name='EncryptedQuery', description='indicates whether encrypted queries are supported.', example='99'),
    needApplyMaterial?: long(name='NeedApplyMaterial', description='Indicates whether application materials are required.', example='46'),
    slaLink?: string(name='SlaLink', description='The URL for the service agreement.', example='example.aliyundoc.com'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-****-****-9DCE-B38165CE4C47'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='false'),
}

model QueryTagApplyRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTagApplyRuleResponseBody(name='body'),
}

/**
 * @summary Queries tag application rules.
 *
 * @param request QueryTagApplyRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTagApplyRuleResponse
 */
async function queryTagApplyRuleWithOptions(request: QueryTagApplyRuleRequest, runtime: Util.RuntimeOptions): QueryTagApplyRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTagApplyRule',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries tag application rules.
 *
 * @param request QueryTagApplyRuleRequest
 * @return QueryTagApplyRuleResponse
 */
async function queryTagApplyRule(request: QueryTagApplyRuleRequest): QueryTagApplyRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTagApplyRuleWithOptions(request, runtime);
}

model QueryTagInfoBySelectionRequest {
  industryId?: long(name='IndustryId', description='The industry ID.', example='58'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sceneId?: long(name='SceneId', description='The scene ID.', example='83'),
  tagId?: long(name='TagId', description='The tag ID.', example='71'),
}

model QueryTagInfoBySelectionResponseBody = {
  code?: string(name='Code', description='The response code. **OK** indicates that the request is successful.', example='OK'),
  data?: [ 
    {
      authCodeList?: [ string ](name='AuthCodeList', description='The list of available authorization codes.'),
      complexityType?: string(name='ComplexityType'),
      demoAddress?: string(name='DemoAddress', description='The URL for the API demo.', example='https://help.aliyun.com/document_detail/388997.html?spm=a2c4g.2573870.0.0.3aa921cbOrtqJz'),
      docAddress?: string(name='DocAddress', description='The URL for the API documentation.', example='https://help.aliyun.com/document_detail/388997.html?spm=a2c4g.2573870.0.0.3aa921cbOrtqJz'),
      enumDefinitionAddress?: string(name='EnumDefinitionAddress', description='The URL for the definitions of the enumerated values.', example='example.aliyundoc.com'),
      flowName?: string(name='FlowName', description='The flow name.', example='process name'),
      industryId?: long(name='IndustryId', description='The industry ID.', example='83'),
      industryName?: string(name='IndustryName', description='The industry name.', example='logistics'),
      paramList?: [ 
        {
          code?: string(name='Code', description='The English name of the parameter.', example='preame'),
          hint?: string(name='Hint', description='The input hint.', example='none'),
          must?: boolean(name='Must', description='Indicates whether the parameter is required.', example='false'),
          name?: string(name='Name', description='The Chinese name of the parameter.', example='none'),
          type?: string(name='Type', description='The type. The code that corresponds to EnumUIWidgetTypes.', example='aqzx'),
          valueDict?: [ 
            {
              code?: string(name='Code', description='The English name.', example='Aliyun'),
              desc?: string(name='Desc', description='The Chinese name.', example='阿里云'),
            }
          ](name='ValueDict', description='The definitions of the enumerated values such as Code or Desc.'),
        }
      ](name='ParamList', description='The list of tag parameters.'),
      richTextDescription?: string(name='RichTextDescription'),
      sceneId?: long(name='SceneId', description='The scene ID.', example='41'),
      sceneName?: string(name='SceneName', description='The scene name.', example='General scenario'),
      tagId?: long(name='TagId', description='The tag ID.', example='31'),
      tagName?: string(name='TagName', description='The tag name.', example='Number ownership'),
    }
  ](name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='1C3B8084-3A7D-570B-BC84-BF945A9CF65E'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='false'),
}

model QueryTagInfoBySelectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTagInfoBySelectionResponseBody(name='body'),
}

/**
 * @summary Queries information about tags.
 *
 * @param request QueryTagInfoBySelectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTagInfoBySelectionResponse
 */
async function queryTagInfoBySelectionWithOptions(request: QueryTagInfoBySelectionRequest, runtime: Util.RuntimeOptions): QueryTagInfoBySelectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.industryId)) {
    query['IndustryId'] = request.industryId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTagInfoBySelection',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about tags.
 *
 * @param request QueryTagInfoBySelectionRequest
 * @return QueryTagInfoBySelectionResponse
 */
async function queryTagInfoBySelection(request: QueryTagInfoBySelectionRequest): QueryTagInfoBySelectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTagInfoBySelectionWithOptions(request, runtime);
}

model QueryTagListPageRequest {
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='The page number. Default value: **1**.', example='18'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='66'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryTagListPageResponseBody = {
  code?: string(name='Code', description='The response code. **OK** indicates that the request is successful.', example='OK'),
  data?: {
    pageNo?: long(name='PageNo', description='The page number.', example='11'),
    pageSize?: long(name='PageSize', description='The number of entries per page.', example='24'),
    records?: [ 
      {
        apiName?: string(name='ApiName', description='The API operation that is called by the frontend.', example='TwoElementsVerification'),
        code?: string(name='Code', description='Code', example='OK'),
        docAddress?: string(name='DocAddress', description='The URL for the API documentation.', example='https://help.aliyun.com/document_detail/388997.html?spm=a2c4g.388997.0.0.cf804cc7DX4vlP'),
        id?: long(name='Id', description='The tag ID.', example='75'),
        industryId?: long(name='IndustryId', description='The industry ID.', example='2'),
        industryName?: string(name='IndustryName', description='The industry name.', example='Test'),
        introduction?: string(name='Introduction', description='The tag description.', example='for autotest new'),
        isOpen?: long(name='IsOpen', description='Indicates whether the number is activated.', example='45'),
        name?: string(name='Name', description='The tag name.', example='Aliyun'),
        saleStatusStr?: string(name='SaleStatusStr', description='*   0: The number is hidden.
*   1: The number is public.', example='1'),
        sceneId?: long(name='SceneId', description='The scene ID.', example='13'),
        sceneName?: string(name='SceneName', description='The scene name.', example='check'),
      }
    ](name='Records', description='The retruned data.'),
    totalCount?: long(name='TotalCount', description='The total number of returned entries.', example='32'),
    totalPage?: long(name='TotalPage', description='The total number of returned pages.', example='91'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='A4475657-BB7E-585D-9E09-37934F096103'),
  success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values:

*   true
*   false', example='true'),
}

model QueryTagListPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTagListPageResponseBody(name='body'),
}

/**
 * @summary Queries a list of tags by page.
 *
 * @param request QueryTagListPageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTagListPageResponse
 */
async function queryTagListPageWithOptions(request: QueryTagListPageRequest, runtime: Util.RuntimeOptions): QueryTagListPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTagListPage',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tags by page.
 *
 * @param request QueryTagListPageRequest
 * @return QueryTagListPageResponse
 */
async function queryTagListPage(request: QueryTagListPageRequest): QueryTagListPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTagListPageWithOptions(request, runtime);
}

model QueryUsageStatisticsByTagIdRequest {
  beginTime?: string(name='BeginTime', description='The beginning of the time range to query.', example='20230308'),
  endTime?: string(name='EndTime', description='The end of the time range to query.', example='20230406'),
  ownerId?: long(name='OwnerId'),
  pageNo?: long(name='PageNo', description='The page number. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='20'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagId?: long(name='TagId', description='The tag ID.', example='14'),
}

model QueryUsageStatisticsByTagIdResponseBody = {
  code?: string(name='Code', description='The response code. **OK** indicates that the request is successful.', example='OK'),
  data?: [ 
    {
      authorizationCode?: string(name='AuthorizationCode', description='The authorization code.', example='g61I8UV5zd'),
      failTotal?: long(name='FailTotal', description='The numbers for which the query failed.', example='71'),
      gmtDateStr?: string(name='GmtDateStr', description='The creation time.', example='20230312'),
      id?: long(name='Id', description='The ID of the authorization code usage record.', example='17'),
      industryName?: string(name='IndustryName', description='The industry name.', example='Home security'),
      partnerId?: long(name='PartnerId', description='The customer product ID (PID).', example='89'),
      sceneName?: string(name='SceneName', description='The scene name.', example='Return visit'),
      successTotal?: long(name='SuccessTotal', description='The numbers for which the query succeeded.', example='93'),
      tagId?: long(name='TagId', description='The tag name.', example='69'),
      tagName?: string(name='TagName', description='The tag name.', example='Alibaba Cloud Query'),
      total?: long(name='Total', description='The total quantity of numbers that are involved in the query.', example='41'),
    }
  ](name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='D45CC751-34DF-5797-81FB-9A2ED6DC024B'),
  success?: boolean(name='Success', description='Indicates whether the call is successful.

*   true
*   false', example='true'),
}

model QueryUsageStatisticsByTagIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryUsageStatisticsByTagIdResponseBody(name='body'),
}

/**
 * @summary Queries the usage statistics based on tag IDs.
 *
 * @param request QueryUsageStatisticsByTagIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryUsageStatisticsByTagIdResponse
 */
async function queryUsageStatisticsByTagIdWithOptions(request: QueryUsageStatisticsByTagIdRequest, runtime: Util.RuntimeOptions): QueryUsageStatisticsByTagIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryUsageStatisticsByTagId',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the usage statistics based on tag IDs.
 *
 * @param request QueryUsageStatisticsByTagIdRequest
 * @return QueryUsageStatisticsByTagIdResponse
 */
async function queryUsageStatisticsByTagId(request: QueryUsageStatisticsByTagIdRequest): QueryUsageStatisticsByTagIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryUsageStatisticsByTagIdWithOptions(request, runtime);
}

model ThreeElementsVerificationRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='QASDW@#**'),
  certCode?: string(name='CertCode', description='The ID card number to be verified.

*   If the value of Mask is NORMAL, specify a value in plaintext for this field.
*   If the value of Mask is MD5, specify a MD5-encrypted value for this field.
*   If the value of Mask is SHA256, specify a SHA256-encrypted value for this field.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='83d8040d3cb2181e04****dc6ff5566d4493876a4a5da782887446356b0a787e'),
  inputNumber?: string(name='InputNumber', description='The phone number to be verified.

*   If the value of Mask is NORMAL, specify a value in plaintext for this field.
*   If the value of Mask is MD5, specify a MD5-encrypted value for this field.
*   If the value of Mask is SHA256, specify a SHA256-encrypted value for this field.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='1390000****'),
  mask?: string(name='Mask', description='The encryption method. Valid values:

*   **NORMAL**: The phone number is not encrypted.
*   **MD5**
*   **SHA256**

This parameter is required.', example='MD5'),
  name?: string(name='Name', description='The name to be verified.

*   If the value of Mask is NORMAL, specify a value in plaintext for this field.
*   If the value of Mask is MD5, specify a MD5-encrypted value for this field.
*   If the value of Mask is SHA256, specify a SHA256-encrypted value for this field.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='Aliyun'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ThreeElementsVerificationResponseBody = {
  code?: string(name='Code', description='The response code.

*   **OK**: The request is successful.
*   For more information, see Error codes in this documentation.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    basicCarrier?: string(name='BasicCarrier', description='The basic carrier. Valid values:

*   **China Mobile**
*   **China Unicom**
*   **China Telecom**', example='China Mobile'),
    isConsistent?: int32(name='IsConsistent', description='Indicates whether the specified name, phone number, and ID card number belong to the same user. Valid values:

* **1**: The specified name, phone number, and ID card number belong to the same user.
* **0**: The specified name, phone number, and ID card number do not belong to the same user.
* **2**: The specified name, phone number, and ID card number cannot be found.

**Note** The phone number registration data of a user is usually updated one or three days after registration. The registration data can be queried only after the update. The following table shows the verification results under different phone number states.

|Carrier/Phone number state|Out-of-service|Nonexistent|Canceled|
|---|---|---|---|
|China Mobile|Verifications can be carried out normally.|The specified name, phone number, and ID card number cannot be found.|The specified name, phone number, and ID card number cannot be found.|
|China Unicom|Verifications can be carried out normally.|The specified name, phone number, and ID card number do not belong to the same user.|The specified name, phone number, and ID card number do not belong to the same user.|
|China Telecom|Verifications can be carried out normally.|The specified name, phone number, and ID card number cannot be found.|The specified name, phone number, and ID card number cannot be found.|', example='1'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE4C47'),
}

model ThreeElementsVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ThreeElementsVerificationResponseBody(name='body'),
}

/**
 * @summary Verifies whether the name, phone number, and ID card number entered by a user belong to the same user.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   You are charged only if the value of Code is OK and the value of IsConsistent is not 2.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ThreeElementsVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ThreeElementsVerificationResponse
 */
async function threeElementsVerificationWithOptions(request: ThreeElementsVerificationRequest, runtime: Util.RuntimeOptions): ThreeElementsVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.certCode)) {
    query['CertCode'] = request.certCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ThreeElementsVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether the name, phone number, and ID card number entered by a user belong to the same user.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   You are charged only if the value of Code is OK and the value of IsConsistent is not 2.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request ThreeElementsVerificationRequest
 * @return ThreeElementsVerificationResponse
 */
async function threeElementsVerification(request: ThreeElementsVerificationRequest): ThreeElementsVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return threeElementsVerificationWithOptions(request, runtime);
}

model TwoElementsVerificationRequest {
  authCode?: string(name='AuthCode', description='The authorization code.

>  On the **My Applications** page in the [Cell Phone Number Service console](https://dytns.console.aliyun.com/analysis/apply), you can obtain the authorization code (also known as authorization ID).

This parameter is required.', example='QASDW@#**'),
  inputNumber?: string(name='InputNumber', description='The phone number to be verified.

*   If the value of Mask is NORMAL, specify a value in plaintext for this field.
*   If the value of Mask is MD5, specify a MD5-encrypted value for this field.
*   If the value of Mask is SHA256, specify a SHA256-encrypted value for this field.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='1390000****'),
  mask?: string(name='Mask', description='The encryption method. Valid values:

*   **NORMAL**: plaintext
*   **MD5**
*   **SHA256**

This parameter is required.', example='MD5'),
  name?: string(name='Name', description='The name to be verified.

*   If the value of Mask is NORMAL, specify a value in plaintext for this field.
*   If the value of Mask is MD5, specify a MD5-encrypted value for this field.
*   If the value of Mask is SHA256, specify a SHA256-encrypted value for this field.

>  Letters in the encrypted strings are not case-sensitive.

This parameter is required.', example='Aliyun'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model TwoElementsVerificationResponseBody = {
  code?: string(name='Code', description='The response code. Valid values:

*   **OK**: The request is successful.
*   For more information, see Error codes in this documentation.
*   **RequestFrequencyLimit**: Repeated queries for the same phone number or name at a high frequency within a short period of time are prohibited due to restrictions that are set by carriers. If this error code is returned, please try again later.', example='OK'),
  data?: {
    basicCarrier?: string(name='BasicCarrier', description='The basic carriers. Valid values:

*   **China Mobile**
*   **China Unicom**
*   **China Telecom**

>  You are not allowed to verify numbers assigned by China Broadnet.', example='China Mobile'),
    isConsistent?: int32(name='IsConsistent', description='Indicates whether the specified name and phone number belong to the same user. Valid values:

* **1**: The specified name and phone number belong to the same user.

* **0**: The specified name and phone number do not belong to the same user.

* **2**: The specified name and phone number cannot be found.

The phone number registration data of a user is usually updated one or three days after registration. The registration data can be queried only after the update. The following table shows the verification results under different phone number states.

|Carrier/Phone number state|Out-of-service|Nonexistent|Canceled|
|---|---|---|---|
|China Mobile|Verifications can be carried out normally.|The specified name and phone number cannot be found.|The specified name and phone number cannot be found.|
|China Unicom|Verifications can be carried out normally.|The specified name and phone number do not belong to the same user.|The specified name and phone number do not belong to the same user.|
|China Telecom|Verifications can be carried out normally.|The specified name and phone number cannot be found.|The specified name and phone number cannot be found.|', example='1'),
  }(name='Data', description='The response parameters.'),
  message?: string(name='Message', description='The returned message.', example='OK'),
  requestId?: string(name='RequestId', description='The request ID.', example='CC3BB6D2-2FDF-4321-9DCE-B38165CE****'),
}

model TwoElementsVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TwoElementsVerificationResponseBody(name='body'),
}

/**
 * @summary Verifies whether the name and phone number entered by a user belong to the same user.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   You are charged only if the value of Code is OK and the value of IsConsistent is not 2.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request TwoElementsVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TwoElementsVerificationResponse
 */
async function twoElementsVerificationWithOptions(request: TwoElementsVerificationRequest, runtime: Util.RuntimeOptions): TwoElementsVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.inputNumber)) {
    query['InputNumber'] = request.inputNumber;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TwoElementsVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Verifies whether the name and phone number entered by a user belong to the same user.
 *
 * @description *   Before you call this operation, make sure that you are familiar with the [billing](https://help.aliyun.com/document_detail/154751.html) of Cell Phone Number Service.
 * *   Before you call this operation, perform the following operations: Log on to the Cell Phone Number Service console. On the [Labels](https://dytns.console.aliyun.com/analysis/square) page, find the label that you want to use, click **Activate Now**, enter the required information, and then submit your application. After your application is approved, you can use the label.
 * *   You are charged only if the value of Code is OK and the value of IsConsistent is not 2.
 * ### [](#qps)QPS limits
 * You can call this operation up to 200 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
 *
 * @param request TwoElementsVerificationRequest
 * @return TwoElementsVerificationResponse
 */
async function twoElementsVerification(request: TwoElementsVerificationRequest): TwoElementsVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return twoElementsVerificationWithOptions(request, runtime);
}

model UAIDCollectionRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值'),
  carrier?: string(name='Carrier', example='示例值'),
  ip?: string(name='Ip', example='示例值示例值示例值'),
  outId?: string(name='OutId', description='This parameter is required.', example='示例值示例值'),
  ownerId?: long(name='OwnerId'),
  province?: string(name='Province', example='示例值示例值'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  token?: string(name='Token', description='This parameter is required.', example='示例值示例值'),
  userGrantId?: string(name='UserGrantId', example='示例值示例值'),
}

model UAIDCollectionResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值'),
  message?: string(name='Message', example='示例值示例值'),
  model?: {
    uaid?: string(name='Uaid', example='示例值'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='示例值示例值示例值'),
}

model UAIDCollectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UAIDCollectionResponseBody(name='body'),
}

/**
 * @summary UAID采集
 *
 * @param request UAIDCollectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UAIDCollectionResponse
 */
async function uAIDCollectionWithOptions(request: UAIDCollectionRequest, runtime: Util.RuntimeOptions): UAIDCollectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.province)) {
    query['Province'] = request.province;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.userGrantId)) {
    query['UserGrantId'] = request.userGrantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UAIDCollection',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary UAID采集
 *
 * @param request UAIDCollectionRequest
 * @return UAIDCollectionResponse
 */
async function uAIDCollection(request: UAIDCollectionRequest): UAIDCollectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return uAIDCollectionWithOptions(request, runtime);
}

model UAIDConversionRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='示例值'),
  carrier?: string(name='Carrier', description='This parameter is required.', example='示例值示例值'),
  outId?: string(name='OutId', example='示例值示例值示例值'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  uaidList?: string(name='UaidList', example='示例值示例值示例值'),
}

model UAIDConversionResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail'),
  code?: string(name='Code', example='示例值示例值'),
  message?: string(name='Message', example='示例值'),
  model?: {
    phoneList?: string(name='PhoneList', example='示例值示例值示例值'),
  }(name='Model'),
  requestId?: string(name='RequestId', example='示例值示例值'),
}

model UAIDConversionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UAIDConversionResponseBody(name='body'),
}

/**
 * @summary uaid号码转换服务
 *
 * @param request UAIDConversionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UAIDConversionResponse
 */
async function uAIDConversionWithOptions(request: UAIDConversionRequest, runtime: Util.RuntimeOptions): UAIDConversionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.uaidList)) {
    query['UaidList'] = request.uaidList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UAIDConversion',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary uaid号码转换服务
 *
 * @param request UAIDConversionRequest
 * @return UAIDConversionResponse
 */
async function uAIDConversion(request: UAIDConversionRequest): UAIDConversionResponse {
  var runtime = new Util.RuntimeOptions{};
  return uAIDConversionWithOptions(request, runtime);
}

model UAIDVerificationRequest {
  authCode?: string(name='AuthCode', description='This parameter is required.', example='HwD97InG'),
  carrier?: string(name='Carrier', description='This parameter is required.', example='CM'),
  ip?: string(name='Ip', example='示例值'),
  outId?: string(name='OutId', example='b8b5b3a*******0b9893484fdf412c99'),
  ownerId?: long(name='OwnerId'),
  province?: string(name='Province', example='示例值示例值'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  token?: string(name='Token', description='This parameter is required.', example='MIGfMA0********3DQEBAQUAA4GNADCB'),
  userGrantId?: string(name='UserGrantId', example='Md****a3Em'),
}

model UAIDVerificationResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='-'),
  code?: string(name='Code', example='OK'),
  data?: {
    uaid?: string(name='Uaid', example='B1E0C1********9F757AF52A035'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', example='68A40250-50CD-034C-B728-0BD******177'),
}

model UAIDVerificationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UAIDVerificationResponseBody(name='body'),
}

/**
 * @summary 获取UAID
 *
 * @param request UAIDVerificationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UAIDVerificationResponse
 */
async function uAIDVerificationWithOptions(request: UAIDVerificationRequest, runtime: Util.RuntimeOptions): UAIDVerificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.carrier)) {
    query['Carrier'] = request.carrier;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.outId)) {
    query['OutId'] = request.outId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.province)) {
    query['Province'] = request.province;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.userGrantId)) {
    query['UserGrantId'] = request.userGrantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UAIDVerification',
    version = '2020-02-17',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取UAID
 *
 * @param request UAIDVerificationRequest
 * @return UAIDVerificationResponse
 */
async function uAIDVerification(request: UAIDVerificationRequest): UAIDVerificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return uAIDVerificationWithOptions(request, runtime);
}

